import java.util.ArrayList;

public class Main {
    public static void main(String[] args){
        System.out.println("Hello World !");
        Solution test= new Solution();
        String [] str1={"abc","vac","caa"};
        System.out.println(test.minDeletionSize(str1));
    }
}
class Solution{
    public  int minDeletionSize(String[] strs){
        ArrayList<String> strarrary=new ArrayList<>();
        for (String x:strs){
            strarrary.add(x);
        }
        for (String x :strarrary){
             char [] charArray  = x.toCharArray();
                for (int i=0;i<charArray.length;i++){
                     if (charArray[i]>charArray[i+1]){
                         int j=strarrary.indexOf(x);
                         strarrary.remove(x);
                         return j;
                     }
                }
        }
//        System.out.println(strarrary);
        return 0;
    }

}